<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:head>Add New Sales Card</h:head>
<body>
	<ui:composition template="/Template/TemplateCommissioned.xhtml">
		<ui:define name="EmployeeContent">

			<h:form id="SalesCardForm">
				<p:panelGrid>
					 <f:facet name="header">
						<h:outputText value="Add New Sales Card" />
					</f:facet>
					<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

					<p:row>
						<p:column>
							<p:outputLabel for="date" value="Date:" />
						</p:column>
						<p:column>
							<p:calendar id="date" value="#{addSalesCard.date}"
								required="true" />
							<p:message for="date" />
						</p:column>
					</p:row>
					<p:row>
						<p:column>
							<p:outputLabel for="amount" value="Amount:" />
						</p:column>
						<p:column>
							<p:inputText id="amount" value="#{addSalesCard.amount}"
								required="true" />
							<p:message for="amount" />
						</p:column>
					</p:row>
					<p:row>
						<p:column colspan="2">
							<p:dialog header="Add sales card" widgetVar="dialogYes" minHeight="40">
   							<p:panelGrid columns="1">
   							 <h:outputText value="Dati Aggiunti" />
   								 <p:button value="Ok" outcome="MySalesCard"></p:button>
   								 </p:panelGrid>
							</p:dialog>
							<p:dialog header="Add sales card" widgetVar="dialogNo" minHeight="40">
   							 <p:panelGrid columns="1">
   							 <h:outputText value="Dati non aggiunti" />
   								 <p:button value="Ok" onclick="PF('dialogNo').hide();"></p:button>
							</p:panelGrid>
							</p:dialog>
							<p:commandButton action="#{addSalesCard.AddNewSalesCard(login.employee)}"
								value="Add Sale" update="SalesCardForm"   />
						</p:column>
					</p:row>
				</p:panelGrid>
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>
